$(function () {
    $(document).on("click", "[data-target]", function () {
        redirect($(this).data("target"), $(this).data("id"));
    })
    $.ajaxSetup({
        dataType: "JSON"
    })
})

function redirect(path, id) {
    path = `views/${path}`;
    $("#divContent").load(path, function () {
        if (window.loadCallback && id) {
            window.loadCallback(id);
        }
    });
}